import 'package:event_bus/event_bus.dart';
import 'package:get/get.dart';
import 'package:razer_one/app/main/utils/app_manager.dart';
import 'package:razer_one/app/modules/home/home/home_page.dart';
import 'package:razer_one/app/modules/me/me/me_page.dart';
import 'package:razer_one/app/modules/root/root_model.dart';

class RootController extends GetxController {
  var currentIndex = 0;
  final pages = [const HomePage(), const MePage()];
  final rootList = [
    RootModel(
      title: "首页",
      icon: "lib/app/resource/images/tabbar/home.png",
      activeIcon: "lib/app/resource/images/tabbar/home_selected.png",
    ),
    RootModel(
      title: "我的",
      icon: "lib/app/resource/images/tabbar/me.png",
      activeIcon: "lib/app/resource/images/tabbar/me_selected.png",
    ),
  ];

  @override
  void onInit() {
    super.onInit();
    AppManager.instance.eventBus = EventBus();
  }

  currentIndexChanged(int index) {
    currentIndex = index;
    update();
  }
}
